import { useDocumentStore } from '../store';
import { isArray } from 'lodash';
class DatabaseManager {
  /**
   * 获取当前的数据库信息
   * */
  get databaseInfo() {
    const dataBase = useDocumentStore.getState().databaseInfo;
    if (!isArray(dataBase) || dataBase.length === 0) {
      return undefined;
    } else {
      return dataBase;
    }
  }
  setDatabaseInfo(databaseInfo: any) {
    useDocumentStore.setState({ databaseInfo });
  }
}
export const databaseManager = new DatabaseManager();
